package com.gitee.ykr.exampleserver;

import com.gitee.ykr.exampleserver.service.HelloService;
import com.gitee.ykr.lightweight.rpc.annotation.EnableNettyRpc;
import com.gitee.ykr.lightweight.rpc.config.NettyRpcProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YKR
 * @Describe
 * @date 2021/9/1
 */
@SpringBootApplication
@RestController
@EnableNettyRpc(basePackages = "com.gitee.ykr")
@EnableEurekaClient
@EnableDiscoveryClient
public class ExampleServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ExampleServerApplication.class, args);
    }


    @Autowired
    HelloService helloService;

    @RequestMapping("/test")
    public String say(){
        return helloService.say();
    }
}
